﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Managistics.Model.Mappings
{
    public class OutputSheetMap : ClassMap<OutputSheet>
    {

        public OutputSheetMap()
        {
            Schema(Constants._tblSchema);
            Table(Constants._tblOutputCustomer);
            LazyLoad();

            Id(x => x.OutputSheetId).GeneratedBy.Assigned().Column("OUTPUT_SHEET_ID");

            References(x => x.SaleOrder).Column("ORDERID");
            Map(x => x.OutputSheetDate).Column("DATE_OUTPUT_SHEET").Not.Nullable();
            Map(x => x.DeliverName).Column("DELIVER_NAME").Length(50);
            Map(x => x.ChangeNoStr).Column("change_no_str").Length(30);
            Map(x => x.TemUpdateOut).Column("tem_update_out").Not.Nullable().Precision(10);

            HasMany(x => x.OutputSheetDetail).KeyColumn("OUTPUT_SHEET_ID");
        }
    }
}
